{block name=report-classes}
<div class="row">
  <div class="col-sm-12">
    <a href="javascript:void(0);" onClick="exportPageToCSV($(this),$('#print-dailypayments2'),'dailypayments.csv');" class="btn btn-info report-green"><span>Export CSV</span></a>
  </div>
</div>
<div class="row form">
  <div class="col-sm-12">
    <a href="javascript:void(0);" onClick="printArea('print-dailypayments2');" class="btn btn-info report-green"><span>Print</span></a>
  </div>
</div>
<div id="print-dailypayments2">
	{foreach $classterms as $term}
	{if !$term}{continue}{/if} 
	<div class="row term">
	  <div class="col-sm-12">
	    <h2 class="title"> {$term.term_name} - {$term.term_region}<!-- {$ct.agegroup_name} | {$ct.class_start_time|date_format:"%H:%M %p"} - {$ct.class_end_time|date_format:"%H:%M %p"} | {$ct.location_suburb}, {$ct.location_state} --></h2>
	  </div>
	  <div class="col-sm-12">
	  {foreach $term.locations as $loc}
  	<div class="location">
	    <h3 class="title">{$loc.location_suburb} - {$loc.location_name} </h3>
	    <table class="table table-striped lblue">
	      <thead>
	        <th>Created Date</th>
	        <th>Class</th>
	        <th>Parent</th>
	        <th>Email</th>
	        <th>Telephone</th>
	        <th>Status</th>
					<th>Classes</th>
	        <th>Merchandise</th>
	        <th>Discount</th>
	        <th>Additional</th>
					<th>Total</th>
					<th>Paid</th>
	      </thead>
	      <tbody>
	      {foreach $loc.classes as $class}
	        {foreach $class.payments as $ct}
	          <tr>
	            <td>{$ct.payment_created}</td>
	            <td>{$class.class_name} - {$class.agegroup_name}</td>
	            <td>{$ct.user_gname} {$ct.user_surname}</td>
	            <td>{$ct.user_email}</td>
	            <td>{$ct.address_telephone}</td>
	            <td>({$ct.order_created|date_format:"%Y-%m-%d"}) {$ct.status_name}</td>
							<td>${$ct.classes|string_format:"%.2f"}</td>
							<td>${$ct.merchandise|string_format:"%.2f"}</td>
	            <td>$-{$ct.payment_discount|string_format:"%.2f"}</td>
	            <td>${$ct.payment_additional|string_format:"%.2f"}</td>
							<td>${$ct.payment_total}</td>
							<td>${$ct.payment_charged_amount}</td>
	          </tr>
	        {/foreach}
	      {/foreach}
	      </tbody>
	    </table>
			</div>
	    {/foreach}
	  </div>
	</div>
	{/foreach}
	
	
	{if $paytypes}
	<div class="row term">
	  <div class="col-sm-12">
	    <h2 class="title">MAKE A PAYMENT</h2>
	  </div>
	  <div class="col-sm-12">
  	<div class="location">
	    <table class="table table-striped lblue">
	      <thead>
	        <th>Created Date</th>
	        <th>Description</th>
	        <th>Parent</th>
	        <th>Email</th>
	        <th>Telephone</th>
	        <th>Status</th>
					<th>Total - Surcharge</th>
					<th></th>
					<th></th>
					<th></th>
					<th>Paid</th>
					<th>Paid</th>
	      </thead>
	      <tbody>
	      {foreach $paytypes as $pa}
	          <tr>
	            <td>{$pa.payment_created}</td>
	            <td>{$pa.paytype_name}</td>
	            <td>{$pa.user_gname} {$pa.user_surname}</td>
	            <td>{$pa.user_email}</td>
	            <td>{$pa.address_telephone}</td>
	            <td>({$pa.order_created|date_format:"%Y-%m-%d"}) {$pa.status_name}</td>
							<td>{assign var='subt' value=$pa.payment_total - $pa.payment_surcharge}${$subt|number_format:2:'.':','}</td>
							<td></td>
							<td></td>
							<td></td>
							<td>${$pa.payment_total}</td>
							<td>${$pa.payment_total}</td>
	          </tr>
	      {/foreach}
	      </tbody>
	    </table>
			</div>
	  </div>
	</div>
	{/if}
</div>
{/block} 


